<template>
  <div class="app-container">
    <div class="prompt">
        <h1>工作提示卡</h1>
        <div class="prompt-main">
          <el-col :span="6" v-for="item in orderTypeStatistics" :key="item.type">
            <div>
              <p class="text1">{{ item.count }}</p>
              <h2>{{ item.type }}</h2>
            </div>
          </el-col>
          <div class="vertical-line"></div>
        </div>
      </div>
  </div>
</template>

<script>
import { orderList, orderTypeStatistics, deleteOrder } from "@/api/system/order";
export default {
  data() {
    return {
      showMap: false,
      //工单类型统计
      orderTypeStatistics: [],
    };
  },
  created() {
    
    this.getOrderTypeStatistics()
  },
  activated(){
    
    this.getOrderTypeStatistics()
  },
  methods: {
    callback(data) {
      console.log(data);
      this.showMap = false;
      // this.form.longitude = data.lng;
      // this.form.latitude = data.lat;
      // this.form.deviceCoordinate = data.geojson;
    },
    //查询工单类型统计
    getOrderTypeStatistics() {
      orderTypeStatistics().then(response => {
        this.orderTypeStatistics = response.data
        // 数据转换
        for (const i in this.orderTypeStatistics) {

          if (this.orderTypeStatistics[i].type === 1) {
            this.orderTypeStatistics[i].type = '接机工作'
          }
          if (this.orderTypeStatistics[i].type === 2) {
            this.orderTypeStatistics[i].type = '送机工作'
          }
          if (this.orderTypeStatistics[i].type === 3) {
            this.orderTypeStatistics[i].type = '维修检查'
          }
          if (this.orderTypeStatistics[i].type === 4) {
            this.orderTypeStatistics[i].type = '长短停及航后离机检查项目'
          }
        }

      })
    },
  },
};
</script>
<style lang="scss" scoped>
.app-container{
  // width: 100%;
  display: flex;
  flex:1;
  justify-content: center;
  text-align: center;
}
.prompt {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  width: 60%;
  height: 100%;
  background-color: #3F8CDA;
  color: white;
  border-radius: 15px;

  h1 {
    text-align: center;
    font-size: 30px;
    letter-spacing: 4px
  }

  .prompt-main {
    display: flex;
    justify-content: center;

    .vertical-line {
      height: 60px;
      width: 1px;
      background-color: #7B8189;
    }

    .el-col {
      text-align: center
    }

    .text1 {
      font-size: 30px;
      font-weight: 20px;
      color: #0FEC76;
      margin: 5px 0;
    }

    .text2 {
      font-size: 30px;
      font-weight: 20px;
      color: #7A8014;
      margin: 5px 0;
    }

    .text3 {
      font-size: 30px;
      font-weight: 20px;
      color: #BAC1D8;
      margin: 5px 0;
    }
  }
}
</style>
